using System;
using System.Windows.Forms;
using ProgramLauncher.Utils;

namespace ProgramLauncher
{
    static class Program
    {
        [STAThread]
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                LogManager.LogInfo("应用程序启动");
                Application.Run(new MainForm());
            }
            catch (Exception ex)
            {
                LogManager.LogError("应用程序发生未处理的异常", ex);
                MessageBox.Show(
                    $"应用程序发生错误：\n\n{ex.Message}",
                    "错误",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
            finally
            {
                LogManager.Shutdown();
            }
        }
    }
} 